#include <bits/stdc++.h>

#define in read()
#define fi first
#define se second
#define pb push_back
#define rep(i, x, y) for(int i = (x); i <= (y); i++)
#define per(i, x, y) for(int i = (x); i >= (y); i--)

using namespace std;

typedef long long ll;
typedef double db;
typedef vector < int > vec;
typedef pair < int , int > pii;

int read() {
    int x = 0; bool f = 0; char ch = getchar(); while(!isdigit(ch)) f |= ch == '-',ch = getchar();
    while(isdigit(ch)) x = x * 10 + (ch ^ 48),ch = getchar(); return f ? -x : x;
}

const string s = "cocacola";

string t;
int id[10], vis[10];

int main() {
#ifndef ONLINE_JUDGE
    freopen("1.in","r",stdin);
#endif
	cin >> t;
	int ans = 1e9;
	rep(i, 0, 7) id[i] = i;
	do {
		bool fl = 0;
		rep(i, 0, 7) if(t[id[i]] != s[i]) fl = true;
		if(fl) continue;
		rep(i, 0, 7) vis[i] = 0;
		int res = 0;
		rep(i, 0, 7) {
			if(id[i] != i && !vis[i]) {
				int x = i;
				while(!vis[x]) {
					vis[x] = true; res++; x = id[x];
				}
				res--;
			}
		} ans = min(ans, res);
	} while(next_permutation(id, id + 8));
	cout << ans << endl;
}
